import {createStore} from 'vuex'
import createPersistedState from 'vuex-persistedstate'

const state ={
    count:1,
    user:{}
}

const mutations={
    add(state,payload){
        state.user = payload
    }
}
//使用插件
const plugins = [
    createPersistedState({
        storage: window.localStorage
    })
]

export default createStore({
    state,mutations,plugins
})

